{% extends "base.html" %}
{% load staticfiles %}
{% block title %}
    {{ newName }}
{% endblock %}
{% block content %}
    <link href="{% static 'css/news.css' %}" rel="stylesheet" >  <!-- 待创建-->
    <!-- 广告横幅-->
    <div class="container-fluid">
        <div class="row">
            <img class="img-responsive model-img" src="{% static 'img/new.jpg' %}">
        </div>
    </div>

    <!--主体内容-->
    <div class="container">
        <div class="row row-3">
                <div class="model-details-title">
                    {{ newName }}
                    <div class="col-md-7 hidden-xs model-details-title-search">
                        <form method="get" action="{% url 'newsApp:search'  %}">  <!--newsApp中名为search的路由-->                            		{% csrf_token %} <!--为了防止csrf（跨站请求伪造）-->
                            <div class="input-group"> <!--bootstrap-->
                                <input type="text" name="keyword" class="form-control" placeholder="请输入关键词" required>
                                <span class="input-group-btn">
                                    <input type="submit" class="btn btn-default" value="查询">
                                </span>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="model-details">
                    {% for mynew in newList %}   <!--newList为后台传过来的新闻数据-->
                    <div class="news-model">
                        <img src="{% static 'img/newsicon.gif' %}">
                        <a href="{% url 'newsApp:newDetail' mynew.id %}"> <b>{{ mynew.title }}</b> </a>
                        <span> 【{{ mynew.publishDate|date:"Y-m-d" }}】</span>
                    </div>
                    {% endfor %}
                </div>
        </div>
    </div>
{% endblock %}

